<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 冲塔怪
  Date: 2022/5/1
  Time: 17:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/jsp/common/left.jsp"%>
<html>
<head>
    <title>编辑商品</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            //给删除的a标签绑定单击事件，防止误触。
            $("a.deleteClass").click(function () {
                return confirm("确认删除吗《"+$(this).parent().parent().find("td:first").text()+"》？");
            });

            $("#searchPageBtn").click(function () {
                var pageNo = $("#pn_input").val();
                location.href = "${pageScope.basePath}${requestScope.page.url}&pageNo="+pageNo;
            });
        });
    </script>
    <style>
        * {
            box-sizing: border-box;
        }
        body {
            font-family: Arial, Helvetica, sans-serif;
        }
        .main{
            margin-left: 160px;
        }
        .header {
            background-color: #f1f1f1;
            padding: 10px;
            text-align: center;
            font-size: 30px;
        }
        .content {
            margin-left: 19%;
            background-color: #ffffff;
            padding: 10px;
        }
    </style>
</head>
<body>
<div class="main">
    <div class="header"><h2>编辑商品</h2></div>
    <div class="content">
        <form action="${pageContext.request.contextPath}/manage/good">
            <input type="hidden" name="pageNo" value="${param.pageNo}">
            <input type="hidden" name="action" value="${param.method}">
            <input type="hidden" name="id" value="${requestScope.good.id}">
            <table>
                <tr>
                    <td>名称</td>
                    <td>价格</td>
                    <td>销量</td>
                    <td>库存</td>
                    <td colspan="2">操作</td>
                </tr>
                <tr>
                    <td><input type="text" name="name" value="${requestScope.good.name}"/></td>
                    <td><input type="text" name="price" value="${requestScope.good.price}"/></td>
                    <td><input type="text" name="sales" value="${requestScope.good.sales}"/></td>
                    <td><input type="text" name="stock" value="${requestScope.good.stock}"/></td>
                    <td><input type="submit" value="提交"/></td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>
